<?php


namespace partner\functions\wechat\lib\SaleInfo;

use partner\functions\wechat\lib\BaseWechatPartner;
use Exception;

class MiniProgramInfo extends BaseWechatPartner
{
    protected $upload_properties = [
        'mini_program_pics' => 5
    ];

    // 服务商小程序APPID
    public $mini_program_appid = '';

    // 商家小程序APPID
    public $mini_program_sub_appid = '';

    // 小程序截图
    public $mini_program_pics = [];

    public function setMiniProgramAppId(string $mini_program_app_id = "")
    {
        $this->mini_program_appid = $mini_program_app_id;
        return $this;
    }

    public function setMiniProgramSubAppId(string $mini_program_sub_appid = "")
    {
        $this->mini_program_appid = $mini_program_sub_appid;
        return $this;
    }

    public function setMinProgramPics(array $mini_program_pics = [])
    {
        if (empty($mini_program_pics))
            throw new Exception("小程序截图不能为空");

        $this->mini_program_pics = $mini_program_pics;
        return $this;
    }
}